import time

from selenium import webdriver

driver=webdriver.Chrome()
# driver=webdriver.Firefox()
driver.get('https://hotel.meituan.com/')
#方法1
d=driver.find_element_by_xpath("//input[@class='dp-input']")#定位到时间控件的输入框
driver.execute_script('arguments[0].removeAttribute(\"readonly\")', d);#清除只读属性
#方法2
js='document.getElementsByTagName("input")[2].removeAttribute("readonly")'
driver.execute_script(js)#清除只读属性
d.clear()
d.send_keys('2022-1-1')
time.sleep(3)
driver.quit()





